package com.latefly.skewwork.ui.page.self

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.Button
import androidx.compose.material3.Card
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController
import com.latefly.skewwork.ui.layout.LayoutViewModel
import com.latefly.skewwork.ui.layout.MainLayout

@Composable
fun SelfPage(
    navController: NavHostController,
    modifier: Modifier,
    layoutViewModel: LayoutViewModel
) {
    MainLayout(
        navController = navController,
        content = {
            Self(navController)
        },
        layoutViewModel = layoutViewModel
    )
}

@Composable
fun Self(
    navController: NavHostController,
    modifier: Modifier = Modifier
) {

    Column(
        horizontalAlignment = Alignment.CenterHorizontally
    ) {
        //头像
        Row(
            modifier = Modifier.padding(top = 30.dp, bottom = 30.dp)
        ) {
            Card(
                modifier = Modifier,
                border = BorderStroke(color = Color.Gray, width = Dp.Hairline),
                shape = CircleShape
            ) {
                Text(text = "     ")
            }
        }
        Row(
            verticalAlignment = Alignment.CenterVertically
        ) {
            Text(text = "账户：XXXXXXXXXXXXX")
        }
        Row(
            verticalAlignment = Alignment.CenterVertically
        ) {
            Text(text = "登录时长：XXXXXXXXXXXXX")
        }
        Row(
            verticalAlignment = Alignment.CenterVertically
        ) {
            Text(text = "等级：XXXXXXXXXXXXX")
        }
        Row {
            Button(
                onClick = { navController.navigate("Self/Setting") },
                modifier = Modifier
                    .weight(1f)
                    .height(50.dp)
            ) {
                Text(text = "更多设置")
            }
        }

    }
}